package com.bigcat.gulimall.gulimallproduct.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.bigcat.gulimall.gulimallproduct.Annotation.ListValue;
import com.bigcat.gulimall.gulimallproduct.valid.AddGroup;
import com.bigcat.gulimall.gulimallproduct.valid.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author sufer
 * @email 123@qq.com
 * @date 2020-09-07 16:03:44
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@NotNull(message = "不能为null",groups = {UpdateGroup.class})
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名必须非空",groups = {AddGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotBlank(message = "logo不能为空",groups = {AddGroup.class})
	@URL(message = "logo必须为一个合法的url")
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotNull(message = "显示状态不能为Null",groups = {AddGroup.class})
//	@Min(value = 0,message = "必须为0或者1",groups = {AddGroup.class,UpdateGroup.class})
//	@Max(value = 1,message = "必须为0或者1",groups = {AddGroup.class,UpdateGroup.class})
	@ListValue(value = {0,1},message = "必须为0或者1",groups = {AddGroup.class,UpdateGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotBlank(message = "检索首字母不能为空",groups = {AddGroup.class})
	@Pattern(regexp = "^[A-Za-z]{1}+$",message = "检索首字母必须为一个字母",groups = {AddGroup.class,UpdateGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "不能为空",groups = {AddGroup.class})
	@Min(value = 0)
	private Integer sort;

}
